home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 6 / CU Amiga Magazine's Super CD-ROM 06 (1996)(EMAP Images)(GB)(Track 1 of 4)[!][issue 1997-01].iso / cucd / readers / utils / gui4cli / ginstall.gc < prev    next >
Text File  |  1996-10-28  |  4KB  |  180 lines

  1. G4C
  2.  
  3. ;       This is a program for the installation of Gui4Cli to your system.
  4. ;       Comodore's Installer, would do a better job, but since I don't
  5. ;       know how to write scripts for it, and since this is an other
  6. ;       excuse for making a gui, here it is.
  7.  
  8. ;       If you have any problems (God forbid), just install it by hand.
  9. ;       Instructions are in the Read.me file 
  10.  
  11.  
  12. WinBig -1 -1 300 105 "Install Gui4Cli"
  13. WinType 11110001
  14. WinOut  "con:0/12/400/80/Gui4Cli Installation/CLOSE/AUTO/WAIT"
  15. usetopaz
  16.  
  17. Line 0 59 300 59 2
  18. Line 0 60 300 60 3
  19. Line 0 61 300 61 1
  20.  
  21. Line 0 80 300 80 2
  22. Line 0 81 300 81 3
  23. Line 0 82 300 82 1
  24.  
  25.  
  26. ;--------------------------------- Start up events --------------------
  27. ; On loading, we check for the Copy, Assign and Makedir commands
  28. ; which we'll need - if not found, inform user & exit
  29.  
  30. xOnLoad
  31. extract GInstall.gc GUIPATH gi_path
  32. cd $gi_path
  33. ifexists file Gui4Cli
  34.    ; ok
  35. else
  36.    ezreq "I'm not in the correct directory\nPlease guide me inside the Gui4Cli directory" "BROWSE..|CANCEL" gi_ask
  37.    if $gi_ask = 0
  38.        GuiQuit GInstall.gc
  39.        Stop
  40.    else
  41.        setvar gi_ask ""
  42.        reqfile -1 -1 250 -60 "Inside the Gui4Cli Dir." DIR gi_ask $gi_path
  43.        if $gi_ask = ""
  44.            GuiQuit GInstall.gc
  45.            Stop
  46.        endif
  47.        CD $gi_ask
  48.        ifexists FILE Gui4Cli
  49.           ;
  50.        else
  51.           ezreq "Gui4Cli not found..\nPlease install manually" 'OK' ""
  52.           GuiQuit GInstall.gc
  53.           Stop
  54.        endif
  55.    endif
  56. endif
  57. setvar gi_dir SYS:Gui4Cli
  58. setvar gi_assign ON
  59. setvar gi_dirmake YES
  60. ifexists assign GUIs
  61.    if guis: F= $gi_path
  62.       ;
  63.    else
  64.       setvar gi_dirmake NO
  65.       setvar gi_dir GUIs:
  66.       setvar gi_assign OFF
  67.       update ginstall.gc 7 0
  68.       update ginstall.gc 2 "Directory exists."
  69.    endif
  70. endif
  71. GuiOpen GInstall.gc
  72. update ginstall.gc 1 $gi_dir
  73.  
  74. xOnQuit
  75. delvar gi_#?
  76.  
  77. xOnClose
  78. GuiQuit GInstall.gc
  79.  
  80. ;------------------------------ Install Gui4Cli program -----------------
  81.  
  82. CTEXT 10 15 "Gui4Cli Installation" topaz.font 8 2 0 000
  83.  
  84.  
  85. xBUTTON 200 4 80 14 "Browse.."
  86. SetVar gi_gdir ""
  87. ReqFile -1 -1 250 -60 "Choose Dir for Gui4Cli" DIR gi_gdir $gi_dir
  88. if $gi_gdir != ""
  89.    joinfile $gi_gdir Gui4Cli gi_dir
  90.    ifexists DIR $gi_dir
  91.         setvar gi_dirmake NO
  92.         setvar gi_assign OFF
  93.         update ginstall.gc 7 0
  94.         update ginstall.gc 2 "Directory Gui4Cli exists"
  95.    else
  96.         setvar gi_dirmake YES   
  97.         setvar gi_assign ON
  98.         update ginstall.gc 7 1
  99.         update ginstall.gc 2 "Will create Directory Gui4Cli"
  100.    endif
  101.    update ginstall.gc 1 $gi_dir
  102. endif
  103.  
  104.  
  105. TEXT 10 20 280 14 "sys:" 120 BOX
  106. GadID 1
  107.  
  108.  
  109. TEXT 10 35 280 14 "Creates Directory named Gui4Cli" 60 NOBOX
  110. GadID 2
  111.  
  112.  
  113. TEXT 10 45 280 14 "Gui and Grx will be copied to c:" 50 NOBOX
  114. GadID 3
  115.  
  116.  
  117. ;====================> Assign GUIs:
  118.  
  119. TEXT 10 65 150 14 "Assign GUIs: in User-Startup?" 30 NOBOX
  120. GadID 4
  121.  
  122. xCHECKBOX  260 65 27 11 "" gi_assign "ON" "OFF" ON
  123. gadID 7
  124.  
  125.  
  126. ;----------------------- Run Install -------------------------------
  127.  
  128. xButton 10 88 100 14 Install!
  129.  
  130.     SetWinTitle GInstall.gc "Installing..."
  131.     FailAt 10
  132.  
  133.     ; copy Gui & Grx
  134.     action copy gui c:
  135.     action copy grx c:
  136.     update ginstall.gc 3 "Gui & Grx copied."
  137.  
  138.     ; Make G4C dir
  139.     if $gi_dirmake = YES
  140.        makedir $gi_dir
  141.        update ginstall.gc 2 "Gui4Cli dir created."
  142.     endif
  143.  
  144.     ; add the assign to s:user-startup
  145.     if $gi_assign = ON
  146.            update GInstall.gc 4 "Assigning..."
  147.            Append s:user-startup "\n;START of Gui4Cli assign\n"
  148.            Append s:user-startup 'assign GUIs: $gi_dir \n'
  149.            Append s:user-startup ";END of Gui4Cli assign\n"
  150.            Assign GUIs: $gi_dir
  151.            update GInstall.gc 4 "GUIs: Assign added."
  152.     endif
  153.  
  154.     ; copy the files
  155.     update GInstall.gc 1 "Copying files..."
  156.     copy #? $gi_dir
  157.     update GInstall.gc 1 "Copying fonts..."
  158.     copy fonts/#? fonts:
  159.     update GInstall.gc 1 "Gui4Cli Installed."
  160.  
  161.  
  162.     SetWinTitle GInstall.gc "Gui4Cli Installation"
  163.     ezreq "Installation finished.\nGui4Cli can be found in $gi_dir" "You don't say.." ""
  164.     GuiQuit GInstall.gc
  165.  
  166.  
  167. ;------------> On failing
  168.  
  169. xOnFail
  170. SetWinTitle GInstall.gc "**** ERROR ****"
  171. EZREQ "ERROR in installation\nPlease read the ReadMe.Now file\nand install manually." "OK" ""
  172. GuiQuit GInstall.gc
  173. Stop
  174.  
  175.  
  176. ;----------------------- Cancel button ------------------------------
  177.  
  178. xBUTTON 185 88 100 14 CANCEL
  179. GuiQuit GInstall.gc
  180.